package stringExertises;

/**
 * @author: bamboo_shoot
 * @date: 20/2/3 18:50
 * @description: 需求：定义一个方法，把数组{1,2,3}按照指定个格式拼接成一个字符串。格式参照如下：[word1#word2#word3]。
 */
public class ConcatenatedString {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3};
        System.out.print("[");
        for (int i = 0; i < arr.length; i++) {
            String str = "word";
            int str2 = arr[i];
            String str3 = "#";
            System.out.print(str.concat(String.valueOf(str2).concat(str3)));
        }
        System.out.print("]");
    }
}
